﻿using J.Model;
using J.ProductGet.Application.Command.ReservationinformationtableCommand;
using MediatR;
using SqlSugar;

namespace J.ProductGet.Application.CommandHandler.ReservationinformationtableCommandHandler
{
    public class RESERVATIONINFORMATIONTABLEBackilCommandHandler : IRequestHandler<RESERVATIONINFORMATIONTABLEBackilCommand, List<RESERVATIONINFORMATIONTABLE>>
    {
        private readonly ISqlSugarClient _sqlSugarClient;
        public RESERVATIONINFORMATIONTABLEBackilCommandHandler(ISqlSugarClient sqlSugarClient)
        {
            _sqlSugarClient = sqlSugarClient;
        }
        public async Task<List<RESERVATIONINFORMATIONTABLE>> Handle(RESERVATIONINFORMATIONTABLEBackilCommand request, CancellationToken cancellationToken)
        {
            return await _sqlSugarClient.Queryable<RESERVATIONINFORMATIONTABLE>().Where(s => s.ReservedInformationID == request.ReservedInformationID).ToListAsync();
        }
    }
}
